home *** CD-ROM | disk | FTP | other *** search
- Path: hopper.acm.org!news
- From: varnk@e62.diebold.com (Ken Varn)
- Newsgroups: comp.lang.c
- Subject: Re: Help with the spawnlp function in TC++ 3.0
- Date: 26 Mar 1996 13:43:31 GMT
- Organization: Diebold
- Message-ID: <4j8sa3$1k0@HOPPER.ACM.ORG>
- References: <UokVxUJdkXxX088yn@CRIS.COM>
- NNTP-Posting-Host: 199.218.232.47
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.7
-
- In article <UokVxUJdkXxX088yn@CRIS.COM>, SCLARK74@CRIS.COM says...
- />
- />Hello,
- />
- />I can't figure out why the following code will not work. What I'm
- />trying to do is execute TCC from with in my C program and pass it the
- />file TEST.C on the command-line. I can get TCC to execute perfectly but
- />no matter what I do, it always ignores the command-line argument. Here's
- />the code.
- />
- />
- />---------------
- />#include <process.h>
- />#include <stdio.h>
- />#include <conio.h>
- />
- />void main(void)
- />{
- /> int result;
- />
- /> result = spawnlp(P_WAIT, "TCC", "TEST.C", NULL);
- /> if (result == -1)
- /> {
- /> perror("Error:");
- /> exit(1);
- /> }
- />}
- />
- />---------------
- />
- />What am I doing wrong here? Thanks for any help!
-
-
- You are not specifying your arguments correctly. Note that the argv[0]
- argument must be the name of the program being run. Argv[1] is the actual
- start of the argument list.
-
- Try this:
-
- result = spawnlp(P_WAIT, "TCC", "TCC", "TEST.C", NULL);
-
-